package com.chinasoft.service.serviceimpl;

import com.chinasoft.mapper.TopCategoryMapper;
import com.chinasoft.mapper.TopItemsMapper;
import com.chinasoft.pojo.TopCategory;
import com.chinasoft.pojo.TopItems;
import com.chinasoft.service.TopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TopServiceImpl implements TopService {

    @Autowired
    private TopCategoryMapper topCategoryMapper;
    @Autowired
    private TopItemsMapper topItemsMapper;

    @Override
    public List<TopCategory> getTopCategories(Integer limit) {
        return topCategoryMapper.selectTopN(limit);
    }

    @Override
    public List<TopItems> getTopItems(Integer limit) {
        return topItemsMapper.selectTopN(limit);
    }
}
